#region File Description
//-----------------------------------------------------------------------------
// MainMenuScreen.cs
//
// Microsoft XNA Community Game Platform
// Copyright (C) Microsoft Corporation. All rights reserved.
//-----------------------------------------------------------------------------
#endregion

#region Using Statements
using Microsoft.Xna.Framework;
using Microsoft.Xna.Framework.Media;
#endregion

namespace GGJ
{
    /// <summary>
    /// The main menu screen is the first thing displayed when the game starts up.
    /// </summary>
    class ChooseLevelMenuScreen : MenuScreen
    {
        #region Initialization


        /// <summary>
        /// Constructor fills in the menu contents.
        /// </summary>
        public ChooseLevelMenuScreen()
            : base("Choose the level")
        {
            // Create our menu entries.
            MenuEntry playGame1MenuEntry = new MenuEntry("Kitchen");
            MenuEntry playGame2MenuEntry = new MenuEntry("Garden");
            MenuEntry backMenuEntry = new MenuEntry("Back");

            // Hook up menu event handlers.
            playGame1MenuEntry.Selected += PlayGame1MenuEntrySelected;
            playGame2MenuEntry.Selected += PlayGame2MenuEntrySelected;
            backMenuEntry.Selected += OnCancel;

            // Add entries to the menu.
            MenuEntries.Add(playGame1MenuEntry);
            MenuEntries.Add(playGame2MenuEntry);
            MenuEntries.Add(backMenuEntry);
        }


        #endregion

        #region Handle Input


        /// <summary>
        /// Event handler for when the Play Game menu entry is selected.
        /// </summary>
        void PlayGame1MenuEntrySelected(object sender, PlayerIndexEventArgs e)
        {

            LoadingScreen.Load(ScreenManager, true, e.PlayerIndex,
                               new GameplayScreen(GameplayScreen.Level.Kitchen));
        }


        /// <summary>
        /// Event handler for when the Options menu entry is selected.
        /// </summary>
        void PlayGame2MenuEntrySelected(object sender, PlayerIndexEventArgs e)
        {
            LoadingScreen.Load(ScreenManager, true, e.PlayerIndex,
                                new GameplayScreen(GameplayScreen.Level.Backyard));
        }


        /// <summary>
        /// When the user cancels the main menu, ask if they want to exit the sample.
        /// </summary>
        protected override void OnCancel(PlayerIndex playerIndex)
        {
            ScreenManager.AddScreen(new MainMenuScreen(), playerIndex);
        }


       


        #endregion
    }
}
